import request from '@/utils/request'

export function listOrder() {
  return request({
    url: '/order/list',
    method: 'get'
  })
}

export function createOrder(data) {
  return request({
    url: '/order/create',
    method: 'post',
    data: data
  })
}

export function payOrder(order_id) {
  return request({
    url: '/order/' + order_id + '/pay',
    method: 'get'
  })
}

export function paidOrder(order_id) {
  return request({
    url: '/order/' + order_id + '/paid',
    method: 'put'
  })
}

export function cancelOrder(order_id) {
  return request({
    url: '/order/' + order_id + '/cancel',
    method: 'put'
  })
}

export function finishOrder(order_id) {
  return request({
    url: '/order/' + order_id + '/finish',
    method: 'put'
  })
}
